home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 13 / develop 13 code / DeviceLoopInDrag / OurMain.h < prev    next >
Encoding:
Text File  |  1992-10-30  |  2.3 KB  |  88 lines  |  [TEXT/MPS ]

  1. // OurMain.h
  2. // Header for our main program.
  3. // Contains all our derived classes and our new classes.
  4. // The TApplication and TDocument folders have been left unchanged.
  5. // The application is tailored in the classes below.
  6.  
  7. #define OURMAIN
  8. #define    override virtual
  9.  
  10. #include ":TApplication:TApplication.h"
  11.  
  12.         // Constants (also see OurMainShared.h).
  13.  
  14. enum {
  15.     kBWOffset =            1,        // B&W ID = Color ID + kBWOffset
  16.     kNoFilterProc =        NULL,
  17.     kInFrontOfAll =        -1,
  18.     kDefaultStorage =     NULL
  19. };
  20.  
  21. // ------------------------------------------------------------------------
  22. // A new art class.
  23. // The art drawn in the window.
  24. class TArt : public HandleObject
  25. {
  26.     private:
  27.         short    fPictID;        // Art PICT ID.
  28.         Rect    fDrawRect;        // Rect of object in window.
  29.     protected:
  30.     public:
  31.         virtual void Draw(short depth);
  32.         virtual void GetDrawRect(Rect& theRect);
  33.         virtual void Init(short resID, short drawLocV, short drawLocH);
  34. };
  35.  
  36. // ------------------------------------------------------------------------
  37. // A new window class.
  38. // Manages everything inside the window.
  39. class TWin : public HandleObject
  40. {
  41.     private:
  42.         TArt*    fArt1;                // Art object
  43.         TArt*    fArt2;                // Art object
  44.         TArt*    fArt3;                // Art object        
  45.         static pascal void DrawProc(short depth, short deviceFlags,
  46.                                             GDHandle hTargetDevice,
  47.                                             long userData);
  48.     protected:
  49.     public:
  50.         TWin();                        // Constructor
  51.         virtual ~TWin();            // Destructor
  52.         virtual void Draw();
  53. };
  54.  
  55. // ------------------------------------------------------------------------
  56. // Derive our document class from the document base class.
  57. // Our derived document class manages the window object.
  58. // The base class manages the Window Manager window pointer.
  59.  
  60. class TOurDoc : public TDocument
  61. {
  62.     private:
  63.         TWin*    fWinObj;            // The window object.
  64.     protected:
  65.     public:
  66.         TOurDoc(short resID);        // Constructor.
  67.         virtual ~TOurDoc();            // Destructor.
  68.         override void DoUpdate();
  69. };
  70.  
  71. // ------------------------------------------------------------------------
  72. // Derive our application class from the application base class.
  73. // Add the About dialog, initialization, and a menu.
  74.  
  75. class TOurApp : public TApplication
  76. {
  77.     private:
  78.         virtual void DoAbout();
  79.         virtual void GetVersion(Str255 versStr);
  80.     protected:
  81.         override void DoMenuCommand(short menuID, short menuItem);
  82.     public:
  83.         virtual void InitOurApp();
  84. };
  85.  
  86.  
  87.  
  88.